package com.example.courtcounter;

import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
  //  int scoreA = 0;
   // int scoreB = 0;
    TextView scorea;
    TextView scoreb;
    int scoreA = 0;
    int scoreB = 0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        scorea = findViewById(R.id.textView12);
        scoreb = findViewById(R.id.textView18);
    }
        public void clicka(View btna){
                // int scoreA = 0;
            if (btna.getId() == R.id.Abbtn) {
                scoreA += 3;
                scorea.setText(String.valueOf(scoreA));
            } else if (btna.getId() == R.id.button4) {
                scoreA += 2;
                scorea.setText(String.valueOf(scoreA));
            } else if (btna.getId() == R.id.button5) {
                scoreA += 1;
                scorea.setText(String.valueOf(scoreA));
            }
        }
        public void clickb(View btnb){
            if (btnb.getId() == R.id.button7) {
                //     int scoreB = 0;
                scoreB += 3;
                scoreb.setText(String.valueOf(scoreB));
            } else if (btnb.getId() == R.id.button8) {
                scoreB += 2;
                scoreb.setText(String.valueOf(scoreB));
            } else if (btnb.getId() == R.id.button9) {
                scoreB += 1;
                scoreb.setText(String.valueOf(scoreB));
            }
        }
        public void clearall(View btn){
            if (btn.getId() == R.id.button6) {
                scoreA = 0;
                scoreB = 0;
                scorea.setText(String.valueOf(scoreA));
                scoreb.setText(String.valueOf(scoreB));
            }
    }
}

